<template>
  <ul class="todo-list">
    <!-- completed: 完成的类名 -->
    <li
      v-for="item in showList"
      :key="item.id"
      :class="{ completed: item.isDone }"
    >
      <div class="view">
        <input v-model="item.isDone" class="toggle" type="checkbox" />
        <label>{{ item.name }}</label>
        <button @click="del({ id: item.id })" class="destroy"></button>
      </div>
    </li>
  </ul>
</template>

<script>
import { mapMutations, mapGetters } from "vuex";
export default {
  methods: {
    ...mapMutations("flle", ["del"]),
  },
  computed: {
    ...mapGetters("flle", ["showList"]),
  },
};
</script>